using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using student_factory.Metier;

namespace student_factory.AffectationEtudiant
{
    public partial class ChoixProfil : Form
    {
        private string idProjet;
        private IList<string> identifiants;

        public ChoixProfil(string idProjet)
        {
            identifiants = new List<string>();
            this.idProjet = idProjet;
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void ChoixProfil_Load(object sender, EventArgs e)
        {
            IList<Profil> profils = DAO.ProfilDAO.getNotFilledProfilByProjet(idProjet);

            foreach (Profil p in profils)
            {
                cmb_profil.Items.Add(p.Pro_nom);
                identifiants.Add(p.Id_i);
            }
        }

        private void bt_OK_Click(object sender, EventArgs e)
        {
            this.Hide();
            new SelectionEtudiants(idProjet,identifiants[cmb_profil.SelectedIndex]).ShowDialog();
        }
    }
}